package com.ww.learn.generic

class AnimalConsumer : Consumer<Animal> {
    override fun consume(t: Animal) {
        println("Animal consumer handling: ${t.name}")
    }
}

class DogConsumer : Consumer<Dog> {
    override fun consume(t: Dog) {
        println("Dog consumer handling: ${t.name}")
        println("Special dog action: ${t.fetch()}")
    }
}

class GeneralConsumer : Consumer<Any> {
    override fun consume(t: Any) {
        println("General consumer handling: $t")
    }
}